<?php echo $this->Section->main();?>
<?php echo $this->Html->css(array(HOST.'/news',HOST.'/form',HOST.'/actions'),null,array('inline'=>false));?>
<?php echo $this->Html->script(array(HOST.'/baner',HOST.'/actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>

<div id="content_header">
	<div class="clear">&nbsp;</div>
</div>	
<div class="clear"></div>
<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('languages')?>
	</div>
	<div class="grid_2">
		<p><?php //crumbs ?>&nbsp;</p>
	</div>
	<div class="grid_1">
		<?php echo $this->element('search')?>
	</div>	
	<div class="clear">&nbsp;</div>
</div>
<div class="clear"></div>

<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('menu-left');?>
	</div>
	<div class="grid_2">
		<?php 
			echo $this->Section->generate(1);
 		?>
		
			<div id="contentArea" class="newsContent" style="width: 100%;">
				
				<?php foreach ($news as $year => $items) {?>
				<?php if($year == date('Y')){?>
				<div class="news-index-cat">
					<h2><?php echo $year?></h2>
					<?php if(is_array($items) && !empty($items)){?>
						<?php echo $this->element('news-items',array('items'=>$items,'columns'=>1,'lenght'=>false))?>
					<?php }?>
				</div>
				<?php }else{?>
				<div class="news-index-cat">
					<h2><?php echo $year?></h2>
					<?php if(is_array($items) && !empty($items)){?>
						<?php echo $this->element('news-items',array('items'=>$items,'columns'=>1,'lenght'=>false))?>
					<?php }?>
				</div>					
				<?php }?>
				<?php }?>
			
			</div>
			<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'|| $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'emplo'){?>
			<div class="actions main_actions">
				<ul>
					<li><?php echo $this->Html->link(__('Aktualnosci', true), array('plugin'=>'calendar','controller'=>'news','action'=>'display'),array('escape'=>false,'class'=>'home')); ?></li>
					<li><?php echo $this->Html->link(__('Dodaj', true), 
						array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
						array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)')); ?></li>					
				</ul>
			</div>
			<?php }?> 		
 		&nbsp;
	</div>
	<div class="grid_1">
		<?php echo $this->element('menu-right');?>
	</div>	
	<div class="clear">&nbsp;</div>
</div>

